﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using GrupyzServices.MailTools;
using GrupyzServices.BdAccess;

namespace GrupyzEmpresas.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View("Porque");
        }

        public ActionResult Porque()
        {
            return View();
        }

        public ActionResult Como()
        {
            return View();
        }

        public ActionResult Rede()
        {
            return View();
        }

        public ActionResult Contactos()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Contactos(ParceiroContactoViewModel model)
        {
            if (ModelState.IsValid)
            {
                ParceiroRepository rep = new ParceiroRepository();
                if (rep.SaveParceiroContacto(model))
                {
                    return View("ReturnContacto");
                }else
                    return View();
            }
            return View();
        }
    }
}
